95a54b83d7428abc078a1733f86ae9701c89ac20,src/test/java/org/assertj/core/api/objectarray/ObjectArrayAssert_filteredOn_not_Test.java,ObjectArrayAssert_filteredOn_not_Test,should_fail_if_given_expected_value_is_null,#,98
Before Change
@Test
public void should_fail_if_given_expected_value_is_null() {
try {
assertThat(employees).filteredOn("name", null);
failBecauseExceptionWasNotThrown(IllegalArgumentException.class);
} catch (IllegalArgumentException e) {
assertThat(e).hasMessage(format("The expected value should not be null.%n"
+ "If you were trying to filter on a null value, please use filteredOnNull(String propertyOrFieldName) instead"));
}
}
After Change
@Test
public void should_fail_if_given_expected_value_is_null() {
thrown.expectIllegalArgumentException(format("The expected value should not be null.%n"
+ "If you were trying to filter on a null value, please use filteredOnNull(String propertyOrFieldName) instead"));
assertThat(employees).filteredOn("name", null);
}